/*
 * NPCList.java
 *
 * Created on September 18, 2007, 4:44 PM
 */
package jia.editor.lists;

import jia.editor.EditorMain;
import jia.editor.forms.NPCForm;
import jia.editor.widgets.NpcTable;
import jia.tools.PanelSwapper;

/**
 *
 * @author  estell
 */
public class pnl_NPCList extends javax.swing.JPanel {

    /** Creates new form NPCList */
    public pnl_NPCList() {
        initComponents();
        scrl_NPCList.setViewportView(new NpcTable(this));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        sp_NPCListMain = new javax.swing.JSplitPane();
        scrl_NPCDetails = new javax.swing.JScrollPane();
        txt_NPCDetails = new javax.swing.JTextPane();
        scrl_NPCList = new javax.swing.JScrollPane();
        btn_NPCAdd = new javax.swing.JButton();
        btn_NPCEdit = new javax.swing.JButton();
        btn_NPCDelete = new javax.swing.JButton();
        btn_NPCCancel = new javax.swing.JButton();

        setPreferredSize(new java.awt.Dimension(800, 580));
        sp_NPCListMain.setBorder(javax.swing.BorderFactory.createTitledBorder(null, java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("title_NPC"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.BELOW_TOP));
        sp_NPCListMain.setDividerLocation(400);
        sp_NPCListMain.setDividerSize(7);
        sp_NPCListMain.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        sp_NPCListMain.setOneTouchExpandable(true);
        txt_NPCDetails.setBackground(new java.awt.Color(0, 0, 0));
        txt_NPCDetails.setEditable(false);
        txt_NPCDetails.setForeground(new java.awt.Color(255, 255, 255));
        scrl_NPCDetails.setViewportView(txt_NPCDetails);

        sp_NPCListMain.setRightComponent(scrl_NPCDetails);

        sp_NPCListMain.setLeftComponent(scrl_NPCList);

        btn_NPCAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/add.png")));
        btn_NPCAdd.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_NPCAdd.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));
        btn_NPCAdd.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_NPCAdd.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_NPCAdd.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_NPCAdd.setNextFocusableComponent(btn_NPCEdit);
        btn_NPCAdd.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_NPCAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_NPCAddActionPerformed(evt);
            }
        });

        btn_NPCAdd.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_NPCAdd.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));

        btn_NPCEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/pencil.png")));
        btn_NPCEdit.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_NPCEdit.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));
        btn_NPCEdit.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_NPCEdit.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_NPCEdit.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_NPCEdit.setNextFocusableComponent(btn_NPCDelete);
        btn_NPCEdit.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_NPCEdit.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_NPCEdit.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));

        btn_NPCDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/delete.png")));
        btn_NPCDelete.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_NPCDelete.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));
        btn_NPCDelete.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_NPCDelete.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_NPCDelete.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_NPCDelete.setNextFocusableComponent(btn_NPCCancel);
        btn_NPCDelete.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_NPCDelete.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_NPCDelete.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));

        btn_NPCCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/door_out.png")));
        btn_NPCCancel.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_NPCCancel.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));
        btn_NPCCancel.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_NPCCancel.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_NPCCancel.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_NPCCancel.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_NPCCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_NPCCancelActionPerformed(evt);
            }
        });

        btn_NPCCancel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_NPCCancel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(sp_NPCListMain, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 642, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(btn_NPCCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_NPCDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(btn_NPCEdit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, btn_NPCAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(btn_NPCAdd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_NPCEdit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_NPCDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 426, Short.MAX_VALUE)
                        .add(btn_NPCCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, sp_NPCListMain, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 558, Short.MAX_VALUE))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btn_NPCAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_NPCAddActionPerformed
        PanelSwapper.swap(new NPCForm(), this);
    }//GEN-LAST:event_btn_NPCAddActionPerformed

    private void btn_NPCCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_NPCCancelActionPerformed
        PanelSwapper.swap(EditorMain.p_defaultAdminPanel, this);
    }//GEN-LAST:event_btn_NPCCancelActionPerformed

    public void setConsoleText(String string) {
        this.txt_NPCDetails.setText(string);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_NPCAdd;
    private javax.swing.JButton btn_NPCCancel;
    private javax.swing.JButton btn_NPCDelete;
    private javax.swing.JButton btn_NPCEdit;
    private javax.swing.JScrollPane scrl_NPCDetails;
    private javax.swing.JScrollPane scrl_NPCList;
    private javax.swing.JSplitPane sp_NPCListMain;
    private javax.swing.JTextPane txt_NPCDetails;
    // End of variables declaration//GEN-END:variables
}
